// CSVViewer.h : Declaration of the CCSVViewer

#ifndef __CSVVIEWER_H_
#define __CSVVIEWER_H_

#include "resource.h"       // main symbols
#include <vector>


/////////////////////////////////////////////////////////////////////////////
// CCSVViewer
class ATL_NO_VTABLE CCSVViewer : 
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<CCSVViewer, &CLSID_CSVViewer>,
	public IDispatchImpl<ICSVViewer, &IID_ICSVViewer, &LIBID_PGLSHELLLib>,
	public IShellExtInit,
    public IContextMenu
{
public:
	typedef std::vector< CString > StringContainer;

	CCSVViewer();

DECLARE_REGISTRY_RESOURCEID(IDR_CSVVIEWER)

DECLARE_PROTECT_FINAL_CONSTRUCT()

BEGIN_COM_MAP(CCSVViewer)
	COM_INTERFACE_ENTRY(ICSVViewer)
	COM_INTERFACE_ENTRY(IDispatch)
    COM_INTERFACE_ENTRY(IContextMenu)
    COM_INTERFACE_ENTRY(IShellExtInit)
END_COM_MAP()

// ICSVViewer
public:
	// IShellExtInit
    STDMETHOD(Initialize)(LPCITEMIDLIST, LPDATAOBJECT, HKEY);
    // IContextMenu
    STDMETHOD(GetCommandString)(UINT, UINT, UINT*, LPSTR, UINT);
    STDMETHOD(InvokeCommand)(LPCMINVOKECOMMANDINFO);
    STDMETHOD(QueryContextMenu)(HMENU, UINT, UINT, UINT, UINT);
protected:
	HRESULT LoadAndPlotFiles();
    HBITMAP     m_hCurveBmp;
	StringContainer m_cFiles;
    TCHAR       m_szDir [MAX_PATH];
};

#endif //__CSVVIEWER_H_
